---
category: Validator
contributors:
    - nbayramberdiyev
created: '2020-04-23'
title: Check if a value is a number
updated: '2021-11-03'
---

**JavaScript version**

```js isNumber.js
const isNumber = (value) => !isNaN(parseFloat(value)) && isFinite(value);
```

**TypeScript version**

```ts isNumber.ts
const isNumber = (value: any): number => !isNaN(parseFloat(value)) && isFinite(value);
```
